Fix multi-shift (3-5) save + add regression tests#1474
Merged
renemadsen merged 8 commits intostablefrom Apr 14, 2026
Merged
Conversation
Replace fragile name-matching (site.Name vs FirstName+LastName) with email-based lookup (worker.Email ↔ Users.Email) across all 3 services. Read PhoneNumber from SDK Workers table where it's actually stored, not from Angular Users table where it was always NULL. Fixes: 8 occurrences in TimeSettingService, TimePlanningWorkingHoursService, and TimePlanningPlanningService. Adds integration tests verifying phone numbers flow through GetAvailableSitesByCurrentUser correctly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The planning save paths only copied shifts 1-2 from the request model onto the PlanRegistration entity, silently dropping shifts 3-5 even though the entity columns exist and the read path sums all five. UpdateByCurrentUserNam (the path reached by the Flutter worker app via gRPC) was missing the assignments entirely. Adds a C# integration test that round-trips all 5 shifts through Update() + EF, and a Playwright E2E that exercises the full web UI save/reload of all 5 shifts in the workday-entity dialog — both serve as regression guards. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- PlanningServiceMultiShiftTests: Update() dereferences currentUserAsync.Id;
stub IUserService.GetCurrentUserAsync to return EformUser { Id = 1 } so the
persistence assertion exercises the real save path instead of swallowing an
NRE as "ErrorWhileUpdatingPlanning".
- dashboard-edit-multishift.spec: simplify pickTime to match the existing
helper pattern and shift all 5 slots away from 00:xx (Material timepicker's
"12" sits at a non-rotateZ position that broke the click locator).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…s.Auth) CI build failed with CS0246: EformUser lives in Microting.eFormApi.BasePn.Infrastructure.Database.Entities, not ...Infrastructure.Models.Auth. Verified with `dotnet build` locally: 0 errors. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The rotateZ-selector approach breaks for hour=0 (the "12" position doesn't render with a stable `rotateZ(0deg)` computed style), so every break-time click (00:05/00:10/…) timed out. Switch to coordinate-based clicks on `.clock-face`, same strategy as time-planning-settings.spec.ts, which handles h=0 uniformly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… test The workday-entity dialog only renders shift rows 3-5 when thirdShiftActive/fourthShiftActive/fifthShiftActive are true on the assigned site. CI defaults them to false, so the test timed out waiting for [data-testid="plannedStartOfShift3"]. Open the assigned-site dialog via #firstColumn0 first and tick the three cascading checkboxes, then proceed with the day-cell edit. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The assigned-site dialog gates the 4th checkbox on `data.thirdShiftActive` and the 5th on `data.fourthShiftActive` — both bound to the dialog input snapshot, not the live form control. So each flag only materialises after a save + reopen. Loop three times: open dialog, tick the next checkbox, save, close. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The prelude was ticking thirdShiftActive on row 0 (#firstColumn0) but the test edits row 3 (#cell3_0), so the workday dialog still opened with the default 2-shift assigned site and timed out waiting for plannedStartOfShift3. Align the assigned-site dialog target with the day-cell target. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Update()andUpdateByCurrentUserNam()inTimePlanningPlanningServicenow copy planned shifts 3-5 from the request model onto thePlanRegistrationentity. Before this, shifts 3-5 were silently dropped on every save even though the entity columns exist and the read path sums all 5.PlanningServiceMultiShiftTestsround-trips all 5 shifts (00:00-01:00 /5min, 02:00-03:00 /10min, 04:00-05:00 /15min, 06:00-07:00 /20min, 07:00-08:00 /25min) throughUpdate()+ EF reload.dashboard-edit-multishift.spec.tsexercises the full web UI — fills all 5 shifts in the workday-entity dialog, saves, reopens, and asserts every field round-trips. Guards against regressions on the Angular + C# side together.Test plan
PlanningServiceMultiShiftTests)dashboard-edit-multishift.spec.tsgps@microting.com: edit multi-shift day in web UI — shifts 3-5 survive reload🤖 Generated with Claude Code